* Apply to: Table A5 simqi.xlsx
* Description:  Figure 4 in Roadmaps

clear

set more off


* Low-knowledge respondents

clear

import excel "...\1805 Roadmaps\Table A5 simqi.xlsx", sheet("Sheet1") firstrow

drop if model==.
drop if model > 2

* Create black values to facilitate bar spacing

set obs 8
replace model = 1 in 8
replace treatment = "blank1" in 8
replace estimate = 0 in 8
replace change = 0 in 8


* Create order term

gen order1 = 0
replace order1 = 1 if treatment=="control" & group=="any"
replace order1 = 2 if treatment=="allinfo"
replace order1 = 3 if treatment=="blank1"
replace order1 = 4 if treatment=="control" & group=="all"
replace order1 = 5 if treatment=="guide"
replace order1 = 6 if treatment=="party"
replace order1 = 7 if treatment=="perspat"
replace order1 = 8 if treatment=="perpty"


sort order1


* Figure 4a (First Difference Spatial Advantage)

graph bar change if model!=., ///
     over(order1, label(nolabels)) ///
     asyvars bargap(0) ylabel(-.30(.10).63) legend(off) ///
	 ytitle("") ///
	 yline(0, lcolor(black)) ///
	 bar(1, lcolor(black) bcolor(gs16)) ///
	 bar(2, lcolor(black) bcolor(gs0)) ///
	 bar(4, lcolor(black) bcolor(gs16)) ///
	 bar(5, lcolor(black) bcolor(gs6)) ///
	 bar(6, lcolor(black) bcolor(gs12)) ///
	 bar(7, lcolor(black) bcolor(gs0)) ///
	 bar(8, lcolor(black) bcolor(gs4)) ///
	 text(-.16 8 "{bf:-.04}", size(large)) ///
	 text(.42 20.5 "{bf:.30 *}{superscript:a}", size(large)) ///
	 text(-.16 44.5 "{bf:-.04}", size(large)) ///
	 text(.41 57 "{bf:.26 *}{superscript:a}", size(large)) ///
	 text(.52 67.5 "{bf:.36 *{superscript:a}}", size(large)) ///
	 text(.40 80 "{bf:.28 *}", size(large)) ///
	 text(.39 92.5 "{bf:.27 *}{superscript:a}", size(large)) ///
	 text(-.43 8 "{bf:Control}" " ") ///
	 text(-.43 19.5 "{bf:Any}" "{bf:Info}") ///
	 text(-.43 43.5 "{bf:Control}" " ") ///
	 text(-.43 56 "{bf:Voter}" "{bf:Guide}") ///
	 text(-.43 67.5 "{bf:Party}" "{bf:Cues}") ///
	 text(-.43 80 "{bf:Spatial}" "{bf:Map}") ///
	 text(-.43 92.5 "{bf:Party +}" "{bf:Map}") ///
	 intensity(*0.9) scheme(s1color) ///
	 note(" " " " " ") ///
     graphregion(color(white)) plotregion(color(white))


* Figure 4b (Predicted Probability Support Moderate)

graph bar estimate if model!=., ///
     over(order1, label(nolabels)) ///
     asyvars bargap(0) ylabel(0(.10).93) legend(off) ///
	 ytitle("") ///
	 bar(1, lcolor(black) bcolor(gs16)) ///
	 bar(2, lcolor(black) bcolor(gs0)) ///
	 bar(4, lcolor(black) bcolor(gs16)) ///
	 bar(5, lcolor(black) bcolor(gs6)) ///
	 bar(6, lcolor(black) bcolor(gs12)) ///
	 bar(7, lcolor(black) bcolor(gs0)) ///
	 bar(8, lcolor(black) bcolor(gs4)) ///
	 text(.60 8 "{bf:.48}", size(large)) ///
	 text(.46 20.5 "{bf:.34}", size(large)) ///
	 text(.60 44.5 "{bf:.48}", size(large)) ///
	 text(.63 57 "{bf:.51}", size(large)) ///
	 text(.36 67.5 "{bf:.24 #}", size(large)) ///
	 text(.46 80 "{bf:.34}", size(large)) ///
	 text(.40 92.5 "{bf:.28}", size(large)) ///
	 text(-.08 8 "{bf:Control}" " ") ///
	 text(-.08 19.5 "{bf:Any}" "{bf:Info}") ///
	 text(-.08 43.5 "{bf:Control}" " ") ///
	 text(-.08 56 "{bf:Voter}" "{bf:Guide}") ///
	 text(-.08 67.5 "{bf:Party}" "{bf:Cues}") ///
	 text(-.08 80 "{bf:Spatial}" "{bf:Map}") ///
	 text(-.08 92.5 "{bf:Party +}" "{bf:Map}") ///
	 intensity(*0.9) scheme(s1color) ///
	 note(" " " " " ") ///
     graphregion(color(white)) plotregion(color(white))

	 
* High-knowledge respondents

clear

import excel "...\1805 Roadmaps\Table A5 simqi.xlsx", sheet("Sheet1") firstrow

drop if model==.
drop if model < 3

* Create black values to facilitate bar spacing

set obs 8
replace model = 1 in 8
replace treatment = "blank1" in 8
replace estimate = 0 in 8
replace change = 0 in 8


* Create order term

gen order1 = 0
replace order1 = 1 if treatment=="control" & group=="any_hi"
replace order1 = 2 if treatment=="allinfo"
replace order1 = 3 if treatment=="blank1"
replace order1 = 4 if treatment=="control" & group=="all_hi"
replace order1 = 5 if treatment=="guide"
replace order1 = 6 if treatment=="party"
replace order1 = 7 if treatment=="perspat"
replace order1 = 8 if treatment=="perpty"


sort order1


* Figure 4c (First Difference Spatial Advantage)

graph bar change if model!=., ///
     over(order1, label(nolabels)) ///
     asyvars bargap(0) ylabel(-.30(.10).63) legend(off) ///
	 ytitle("") ///
	 yline(0, lcolor(black)) ///
	 bar(1, lcolor(black) bcolor(gs16)) ///
	 bar(2, lcolor(black) bcolor(gs0)) ///
	 bar(4, lcolor(black) bcolor(gs16)) ///
	 bar(5, lcolor(black) bcolor(gs6)) ///
	 bar(6, lcolor(black) bcolor(gs12)) ///
	 bar(7, lcolor(black) bcolor(gs0)) ///
	 bar(8, lcolor(black) bcolor(gs4)) ///
	 text(.47 8 "{bf:.35 }{superscript:a}", size(large)) ///
	 text(.42 20.5 "{bf:.30 }{superscript:a}", size(large)) ///
	 text(.48 44.5 "{bf:.36 }{superscript:a}", size(large)) ///
	 text(.45 57 "{bf:.31 }{superscript:a}", size(large)) ///
	 text(.56 67.5 "{bf:.44 }{superscript:a}", size(large)) ///
	 text(.44 80 "{bf:.32 }{superscript:a}", size(large)) ///
	 text(.28 92.5 "{bf:.16}", size(large)) ///
	 text(-.38 8 "{bf:Control}" " ") ///
	 text(-.38 19.5 "{bf:Any}" "{bf:Info}") ///
	 text(-.38 43.5 "{bf:Control}" " ") ///
	 text(-.38 56 "{bf:Voter}" "{bf:Guide}") ///
	 text(-.38 67.5 "{bf:Party}" "{bf:Cues}") ///
	 text(-.38 80 "{bf:Spatial}" "{bf:Map}") ///
	 text(-.38 92.5 "{bf:Party +}" "{bf:Map}") ///
	 intensity(*0.9) scheme(s1color) ///
	 note(" " " " " ") ///
     graphregion(color(white)) plotregion(color(white))


* Figure 4d (Predicted Probability Support Moderate)

graph bar estimate if model!=., ///
     over(order1, label(nolabels)) ///
     asyvars bargap(0) ylabel(0(.10).93) legend(off) ///
	 ytitle("") ///
	 bar(1, lcolor(black) bcolor(gs16)) ///
	 bar(2, lcolor(black) bcolor(gs0)) ///
	 bar(4, lcolor(black) bcolor(gs16)) ///
	 bar(5, lcolor(black) bcolor(gs6)) ///
	 bar(6, lcolor(black) bcolor(gs12)) ///
	 bar(7, lcolor(black) bcolor(gs0)) ///
	 bar(8, lcolor(black) bcolor(gs4)) ///
	 text(.23 8 "{bf:.11}", size(large)) ///
	 text(.31 20.5 "{bf:.19}", size(large)) ///
	 text(.22 44.5 "{bf:.10}", size(large)) ///
	 text(.34 57 "{bf:.22}", size(large)) ///
	 text(.23 67.5 "{bf:.11}", size(large)) ///
	 text(.44 80 "{bf:.32}", size(large)) ///
	 text(.22 92.5 "{bf:.10}", size(large)) ///
	 text(-.08 8 "{bf:Control}" " ", size(medsmall)) ///
	 text(-.08 19.5 "{bf:Any}" "{bf:Info}") ///
	 text(-.08 43.5 "{bf:Control}" " ") ///
	 text(-.08 56 "{bf:Voter}" "{bf:Guide}") ///
	 text(-.08 67.5 "{bf:Party}" "{bf:Cues}") ///
	 text(-.08 80 "{bf:Spatial}" "{bf:Map}") ///
	 text(-.08 92.5 "{bf:Party +}" "{bf:Map}") ///
	 intensity(*0.9) scheme(s1color) ///
	 note(" " " " " ") ///
     graphregion(color(white)) plotregion(color(white))

* End
